package annotation.display;

import calm.museum.R;
import android.app.Activity;
import android.os.Bundle;
import android.os.Environment;
import android.view.View;
import android.widget.Button;
import android.widget.MediaController;
import android.widget.TextView;
import android.widget.VideoView;

public class videoPlayer extends Activity {
	private VideoView videoView;
	private TextView descri;
	private Button cancel1,play;
	private MediaController mc;
	
	public void onCreate(Bundle icicle) {
		
		super.onCreate(icicle);
		this.setTitle("Annotation Vid�o");
		setContentView(R.layout.touch_video);
	
		cancel1 = (Button) findViewById(R.id.cancel);
		play = (Button) findViewById(R.id.play);
		descri = (TextView) findViewById(R.id.description);
		descri.setText("Annotation: "+this.getIntent().getExtras().getString("description"));

		videoView = (VideoView) findViewById(R.id.videoplay);
		
		String path=this.getIntent().getExtras().getString("video");;     
		
		mc = new MediaController(this);
		videoView.setVideoPath(path);
	    videoView.setMediaController(mc);
	    mc.setAnchorView(videoView);
		videoView.requestFocus();
		
		cancel1.setOnClickListener(new View.OnClickListener() {
	        public void onClick(View v) {
	        	try {
		        	videoView.stopPlayback();
		        	finish();
	        	}catch (Exception e) {
	        		
	        	}
	        }
	    });
		
		play.setOnClickListener(new View.OnClickListener() {
	        public void onClick(View v) {
	        	videoView.start();
	        	mc.show(10000);
	        }
	    });
		
	}
	
	

}
